<?php

class UserProfileOperation{
    
    private $log;
    public function __construct(){
       $this->log = Logger::getLogger(__CLASS__); 
    }
    
    public function createUserProfile($createUserProfileRequest){
        $printArray = new PrintArray();
        $this->log->info($printArray->printArrayMultilineStyle($createUserProfileRequest));
        
        $dateTime = date("Y-m-d h:i:s A");
        $refId = rand(10,10000000);
        $response = array();
        $response['createUserProfileResponseHeader'] = array('refId'=>$refId,'dateTime'=>$dateTime,'responseCode'=>'0','responseDesc'=>'success');
        $response['createUserProfileResponseDetail'] = array('refId'=>$refId
                                                             ,'dateTime'=>$dateTime
                                                             ,'UserId'=>'aot.maha@gmail.com'
                                                             ,'GenderCode'=>'01'
                                                             ,'TitleCode'=>'01'
                                                             ,'FirstName'=>'Todsaporn'
                                                             ,'MiddleName'=>'M'
                                                             ,'LastName'=>'Mahachan'
                                                             ,'Address1'=>'13/6 หมู่ 7'
                                                             ,'Address2'=>''
                                                             ,'Address3'=>''
                                                             ,'Street'=>'สุขุมวิท'
                                                             ,'SubDistrictCode'=>'01'
                                                             ,'DistrictCode'=>'02'
                                                             ,'ProvinceCode'=>'03'
                                                             ,'PostCode'=>'20180'
                                                             ,'Telephone'=>'0858394412'
                                                             ,'MobilePhone'=>'0858394412'
                                                             ,'CreateBy'=>'System'
                                                             ,'CreateDate'=>$dateTime
                                                             ,'UpdateBy'=>'System'
                                                             ,'UpdateDate'=>$dateTime
                                                            );
        return $response;
    }
    
    public function updateUserProfile($updateUserProfileRequest){
        $printArray = new PrintArray();
        $this->log->info($printArray->printArrayMultilineStyle($updateUserProfileRequest));
        
        $dateTime = date("Y-m-d h:i:s A");
        $refId = rand(10,10000000);
        $response = array();
        $response['updateUserProfileResponseHeader'] = array('refId'=>$refId,'dateTime'=>$dateTime,'responseCode'=>'0','responseDesc'=>'success');
        $response['updateUserProfileResponseDetail'] = array('refId'=>$refId
                                                             ,'dateTime'=>$dateTime
                                                             ,'UserId'=>'aot.maha@gmail.com Update'
                                                             ,'GenderCode'=>'01'
                                                             ,'TitleCode'=>'01'
                                                             ,'FirstName'=>'Todsaporn'
                                                             ,'MiddleName'=>'M'
                                                             ,'LastName'=>'Mahachan'
                                                             ,'Address1'=>'13/6 หมู่ 7'
                                                             ,'Address2'=>''
                                                             ,'Address3'=>''
                                                             ,'Street'=>'สุขุมวิท'
                                                             ,'SubDistrictCode'=>'01'
                                                             ,'DistrictCode'=>'02'
                                                             ,'ProvinceCode'=>'03'
                                                             ,'PostCode'=>'20180'
                                                             ,'Telephone'=>'0858394412'
                                                             ,'MobilePhone'=>'0858394412'
                                                             ,'CreateBy'=>'System'
                                                             ,'CreateDate'=>$dateTime
                                                             ,'UpdateBy'=>'System'
                                                             ,'UpdateDate'=>$dateTime
                                                            );
        return $response;
        
    }
    
    public function changePassword($changePasswordRequest){
        $printArray = new PrintArray();
        $this->log->info($printArray->printArrayMultilineStyle($changePasswordRequest));
        
        $response = array();
        $dateTime = date("Y-m-d h:i:s A");
        $refId = rand(10,10000000);
        $response = array();
        $response['changePasswordResponseHeader'] = array('refId'=>$refId,'dateTime'=>$dateTime,'responseCode'=>'0','responseDesc'=>'success');
        
        return $response;
    }
}
?>
